@section('content')
<div class="am-g m-user">
	<div class="am-u-md-12">
		<div class="m-user-title am-cf">
			<h1><a href="{{URL::to('user/order-list')}}">订单</a></h1>
			<!-- 
			<span class="free-tip">订单满500元免运费</span>
			 -->
		</div>
	</div>
	
	<div class="am-u-md-12">
		<div class="m-user-hd">
			<ul class="am-cf">
				<li><a href="{{URL::to('user/order-list')}}">我的订单</a></li>
				<li><a href="{{URL::to('user/address-list')}}">地址</a></li>
				<li><a href="{{URL::to('user/info')}}">登陆资料</a></li>
				<li><a href="{{URL::to('user/favorite-list')}}">收藏夹</a></li>
			</ul>
		</div>
	</div>
	<div class="am-u-md-6 m-user-order-block">
		<h3>送货地址</h3>
		@if(!empty($order->address))
		<span>{{$order->address->name}}</span><br>
		<span>{{$order->address->province}} {{$order->address->city.$order->address->district.$order->address->street}} {{$order->address->zipcode}}</span><br>
		<span>手机:{{$order->address->mobile}}</span><br>
		<span>订单号:{{$order->id}}</span><br>
		@else
		<span>该地址已经不存在，可能被您删除了</span>
		@endif
	</div>
	<div class="am-u-md-6 m-user-order-block">
		@if(!empty($order->card))
		<h3>卡片内容</h3>
		<div>{{$order->card->content}}</div>
		@endif
	</div>
	
	<div class="am-u-md-12 m-cart-table-box">
		<table class="am-table m-cart-table">
		    <thead>
		        <tr>
		            <th>商品</th>
		            <th>价格</th>
		            <th>数量</th>
					<th>金额</th>
		        </tr>
		    </thead>
		    <tbody>
				@foreach($order->products as $orderProduct)
		        <tr>
		            <td>
						<div class='m-cart-item am-cf'>
							<a href="{{URL::to('product/',$order->id)}}"><img src='{{Images::url($orderProduct->product->image,72,72)}}'></img><a>
					  		<div class='m-cart-item-bd'>
					  			<div class='name'>{{$orderProduct->product->enname}}</div>
					  			<div class='name'>{{$orderProduct->product->name}}</div>
								@if (!empty($orderProduct->size))
		                        <div class='name'>尺寸:{{$orderProduct->size}}</div>
								@endif
								@if (!empty($orderProduct->color))
		                        <div class='name'>颜色:{{$orderProduct->color}}</div>
								@endif
					  		</div>
						</div>
					</td>
		            <td>¥{{number_format($orderProduct->price,2)}}</td>
		            <td><span class='quantity'>{{$orderProduct->quantity}}</span></td>
					<td>¥<span class='money'>{{number_format($orderProduct->quantity * $orderProduct->price,2)}}<span></td>
		        </tr>
				@endforeach
		    </tbody>
		</table>
	</div>
	
	<div class="am-u-md-12 ">
		
		<div class="m-cart-back">
			<!-- 
			<a href="javascript:history.go(-1);"><i class="am-icon-angle-double-left"></i> 继续购物</a>
			 -->
		</div>
		
		<div class="m-cart-stat">
			<div>小计:<span class="subtal-value">¥ {{number_format($order->product_total_price,2)}} 元</span></div>
			<div class="freight">运费:<span class="freight-value">¥ {{number_format($order->freight,2)}} 元</span></div>
			<div class="total">总计:<span class="total-value">¥ {{number_format($order->freight + $order->product_total_price,2)}} 元</span></div>
		</div>
	</div>
</div>
@stop

@section('script')

@stop
